/**
 * 
 */
package hcl.mygrails.window;

import hcl.mygrails.Constants;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

/**
 * Main window.
 * 
 * @author xnnyygn
 * 
 */
public class MainWindow {

	private Display display = null;
	private Shell shell = null;

	/**
	 * Create main window
	 */
	public MainWindow() {
		display = Display.getDefault();
		shell = new Shell(display);
		shell.setText(Constants.APP_NAME);
	}

	/**
	 * Open window
	 */
	public void open() {
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}
}
